home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: dmocc2.on.bell.ca!bc2cep!news
- From: Eric Marc Loebenberg <loebenbe@qc.bell.ca>
- Subject: Help? Confusion with CFileDialog and default file extensions
- X-Nntp-Posting-Host: cmocft.qc.bell.ca
- Content-Type: text/plain; charset=us-ascii
- Message-ID: <316EC9EE.6BDB@qc.bell.ca>
- Sender: news@on.bell.ca (news admin)
- Content-Transfer-Encoding: 7bit
- Cc: loebenbe@post.sygma.net
- Organization: Bell Sygma
- Mime-Version: 1.0
- Date: Fri, 12 Apr 1996 21:23:58 GMT
- X-Mailer: Mozilla 2.0 (Win95; I)
-
- Can anyone clear this up for me?
-
- When using Windows 3.11, MSVC++ 1.52, the CFileDialog worked in a way I
- understood. Let's say I construct a dialog like this:
-
- CFileDialog dlg(TRUE,"mtr","*.mtr", OFN_HIDEREADONLY, Message);
-
- "*.mtr" appears initially in the file name field and if the users
- avoids putting on an extension, CFileDialog adds .mtr as indicated in
- the second argument.
-
- This works well.
-
- Now I move to Windows 95 and MSVC++ Version 4.0 and the latest MFC.
-
- When I do the same thing, CFileDialog behaves differently.
-
- If the user simply types FRED, CFileDialog returns FRED.MTR
- but if the user types fred.mtp ===> OUCH, CFileDialog returns
- fred.mtp.mtp, thus always adds .MTP no matter what the users types.
-
- I want this added within the framework of CFileDialog because there
- are several checks (e.g. file existence) that occur.
-
- Is there a way to make this dialog behave more like the MFC 2.5 version
- where .mtr is added only if no extension is used?
-
- Thanks. I tried to play with the new OFN_NOLONGNAMES and this is unrelated
- to my problem.
-
- Eric Marc Loebenberg
- Bell Sygma Inc.
- Montreal, Quebec , Canada.
-